//                       .::::.
//                     .::::::::.
//                    :::::::::::
//                 ..:::::::::::'
//              '::::::::::::'
//                .::::::::::
//           '::::::::::::::..
//                ..::::::::::::.
//              ``::::::::::::::::
//               ::::``:::::::::'        .:::.
//              ::::'   ':::::'       .::::::::.
//            .::::'      ::::     .:::::::'::::.
//           .:::'       :::::  .:::::::::' ':::::.
//          .::'        :::::.:::::::::'      ':::::.
//         .::'         ::::::::::::::'         ``::::.
//     ...:::           ::::::::::::'              ``::.
//    ```` ':.          ':::::::::'                  ::::..
//                       '.:::::'                    ':'````..
package com.xw.controller.api;

import com.xw.service.TypeService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("/api/type/")
@Scope("prototype")
public class ApiTypeController {

    @Resource
    private TypeService typeService;

    /**
     *  搜索热词
     * @param page
     * @param limit
     * @return
     */
    @RequestMapping(value = "findHotType",method = RequestMethod.POST)
    @ResponseBody
    public Object findHotType(Integer page, Integer limit){
        Map map = typeService.findHotType(page,limit);
        return map;
    }

    /**
     * 查询所有分类
     * @return
     */
    @RequestMapping(value = "findType",method = RequestMethod.POST)
    @ResponseBody
    public Object findType(){
        Map map = typeService.findType();
        return map;
    }

}
